package com.dd.cloud.user.service.educationvisit;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dd.cloud.user.entity.educationvisit.PatientEducationVisit;
import com.dd.cloud.user.entity.educationvisit.PatientEducationVisitPushRecord;
import com.dd.cloud.user.req.education.*;
import com.dd.cloud.user.res.education.PatientEducationOrderRes;
import com.dd.cloud.user.res.education.PatientEducationRecordOrderRes;
import com.dd.cloud.user.res.education.PatientEducationRecordRes;
import com.dd.cloud.user.res.education.PatientEducationUseDrugRes;

/**
 * <p>
 * 患教文章管理 服务类
 * </p>
 *
 * @author czg
 * @since 2024-01-15
 */
public interface IPatientEducationVisitService extends IService<PatientEducationVisit> {

    /**
     * 查询患教文章(分页)
     *
     * @param req
     * @return
     */
    Page<PatientEducationVisit> queryPatientEducationArticlePage(PatientEducationArticleReq req);

    /**
     * 订单详情模块 查询患教文章/问卷(分页)
     *
     * @param req
     * @return
     */
    IPage<PatientEducationOrderRes> queryPatientEducationOrder(PatientEducationOrderReq req);

    /**
     * 添加患教文章
     *
     * @param from
     * @deprecated
     */
    void insertPatientEducationArticle(PatientEducationArticleAddFrom from);

    /**
     * 修改患教文章
     *
     * @param from
     * @deprecated
     */
    void updatePatientEducationArticle(PatientEducationArticleUpdateFrom from);

    /**
     * 文章id
     *
     * @param articleId
     * @return
     */
    PatientEducationVisit queryPatientEducationArticleDetailById(Integer articleId);

    /**
     * 修改患教状态
     *
     * @param articleId
     * @param status
     * @return
     */
    void updatePatientEducationArticleStatus(Integer articleId, Integer status);

    /**
     * 添加患教数量
     *
     * @param articleId
     */
    void updatePatientEducationArticleReadCount(Integer articleId);

    /**
     * 查询患教记录
     *
     * @param req
     * @return
     */
    Page<PatientEducationRecordRes> queryPatientEducationPushRecordPage(PatientEducationPushRecordReq req);

    /**
     * 推送
     *
     * @param id
     */
    void pushPatientEducationPushRecord(Integer id);

    /**
     * 查询用药提醒记录
     *
     * @param req
     * @return
     */
    Page<PatientEducationUseDrugRes> queryUserDrugRecordPage(PatientEducationVisitReq req);

    /**
     * 问卷填写
     *
     * @param content
     * @param id
     */
    void writeQuestionnaire(String content, Integer id);

    /**
     * 填写问卷感受
     *
     * @param id    随访id
     * @param feel  随访感受
     * @param reply 随访回复
     */
    void writeQuestionnaireFeel(String feel, String reply, Integer id);

    /**
     * 查询患教/随访详情
     *
     * @param id
     * @return
     */
    PatientEducationVisitPushRecord queryPatientEducationVisitPushRecordDetail(Integer id);

    /**
     * 查询患教
     */
    Page<PatientEducationRecordRes> queryCloudConsultingRoomPage(PatientEducationPushRecordReq req);

    /**
     * 查询是否提交随访
     *
     * @param id
     * @return
     */
    Boolean queryIsSubmitFeedBack(Integer id);

    /**
     * 推送随访/患教模板给患者
     *
     * @param id
     * @param type
     * @param medId
     */
    void pushTemplateToPatient(Integer id, Integer type, String medId, String orderNo);

    /**
     * 创建电话随访记录
     *
     * @param req
     */
    void createPatientEducationVisitRecordSystem(PatientEducationVisitRecordSystemCreateReq req);

    /**
     * 订单模块 查询患教文章/随访/电话随访/用药提醒记录
     *
     * @param req
     * @return
     */
    IPage<PatientEducationRecordOrderRes> queryPatientEducationRecordOrder(PatientEducationRecordOrderReq req);

    /**
     * 定时发送用药提醒
     */
    void taskPatientDrugTip();

    /**
     * 重新推送用药提醒
     *
     * @param id      推送用药提醒记录id
     * @param medId   就诊卡号
     * @param tencode 处方编号
     */
    void againPushDrugTemplateToPatient(Integer id, String medId, String tencode);
}
